package ooday02.AnimalCase;

public class AnimalTest {
    public static void main(String[] args) {
        Chick chick = new Chick("小坤", 2, "黑");
        chick.eat();//调用Chick类重写后的方法eat()
        chick.drink();//复用Animal类的方法drink()
        chick.layEggs();//调用Chick类特有的方法layEggs()

        Dog dog = new Dog("大黄", 4, "黄");
        dog.eat();//调用Dog类重写后的方法eat()
        dog.drink();//复用Animal类的方法drink()
        dog.lookHome();//调用Dog类特有的方法lookHome()
        dog.swim();//调用Dog类重写后的方法swim()

        Fish fish = new Fish("泡泡", 10, "红");
        fish.eat();//调用Fish类重写后的方法eat()
        fish.drink();//复用Animal类的方法drink()
        fish.swim();////调用Fish类重写后的方法swim()

    }
}
